Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

When ssh and path are specified as separate top-level options in wp-cli.yml, the path option is not applied. This works correctly in aliases and on the command line, but not at the config root level.

Changes

Added "Using path with SSH" subsection to Remote (SSH) configuration documenting:

  • Limitation: Separate top-level ssh and path options don't work together (path is ignored)
  • Working approaches:
    • Path suffix in SSH string: ssh: user@host~/path/to/wordpress
    • Separate options within an alias: @alias: { ssh: user@host, path: /path }
    • Command-line override: wp --path=/path command

Example

Instead of:

ssh: ssh-config-alias
path: path/to/wp-on-remote-server

Use:

ssh: ssh-config-alias~/path/to/wp-on-remote-server

Or define an alias:

@remote:
  ssh: ssh-config-alias
  path: /path/to/wp-on-remote-server
Original prompt

This section details on the original issue you should resolve

<issue_title>wp-cli.yml with ssh not using path</issue_title>
<issue_description>Strangely enough I can get this to work without problem:

wp --ssh=ssh-config-alias --path=path/to/wp-on-remote-server rewrite flush

but if I create a wp-cli.yml on my project root with the following:

ssh: ssh-config-alias
path: path/to/wp-on-remote-server

I then get:

$ wp rewrite flush
Error: This does not seem to be a WordPress installation.
Pass --path=`path/to/wordpress` or run `wp core download`.

It seems that the config file is only applying the ssh option but not path as If I then run the below, it works.

wp --path=path/to/wp-on-remote-server rewrite flush 

So apparently, I am unable to get wp-cli.yml working with SSH.</issue_description>

Comments on the Issue (you are @copilot in this section)

@danielbachhuber > Honestly, I would expect both to work so there seems to be at least room for improvement here (at least in terms of documentation).

I don't think we should change the existing behavior, but additional documentation seems fine.</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix path not applying in wp-cli.yml with SSH Document ssh+path configuration limitation in wp-cli.yml Feb 2, 2026
Copilot AI requested a review from swissspidy February 2, 2026 18:32
@swissspidy swissspidy requested a review from Copilot February 3, 2026 01:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request documents a known limitation where the path configuration option is ignored when specified alongside ssh as separate top-level options in wp-cli.yml, though it works correctly when used in aliases or via command-line parameters.

Changes:

  • Added "Using path with SSH" subsection explaining the limitation and providing three working approaches
  • Documented that separate top-level ssh and path options don't work together, but work fine in aliases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When using SSH connections, you can specify the remote WordPress path in two ways:

1. **As a suffix in the SSH connection string** (recommended):
```
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first code block is missing the yaml language marker. The second code block at line 348 has yaml marker, but this one doesn't. For consistency, both should have the same format.

Suggested change
```
```yaml

Copilot uses AI. Check for mistakes.
path: /path/to/wordpress
```

**Important:** When using `ssh` and `path` as separate top-level options in `wp-cli.yml` (not within an alias), the `path` option may not be applied correctly. In such cases, use one of the following workarounds:
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording "may not be applied correctly" is vague. Based on the original issue description, the path option is actually ignored (not applied at all), not just incorrectly applied. Consider changing this to "the path option is not applied" or "the path option will be ignored" for more accurate documentation.

Suggested change
**Important:** When using `ssh` and `path` as separate top-level options in `wp-cli.yml` (not within an alias), the `path` option may not be applied correctly. In such cases, use one of the following workarounds:
**Important:** When using `ssh` and `path` as separate top-level options in `wp-cli.yml` (not within an alias), the `path` option will be ignored. In such cases, use one of the following workarounds:

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wp-cli.yml with ssh not using path

2 participants